package com.develop.skwen.electricgomall.category.itemList.holder;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.develop.skwen.basemodule.list.BaseHolder;
import com.develop.skwen.electricgomall.R;
import com.develop.skwen.electricgomall.category.model.CategoryItemBean;

/**
 * Created by skwen on 2018/6/24.
 */

public class CategoryItemHolder extends BaseHolder<CategoryItemBean> {

    private ImageView mItemIcon;

    private TextView mItemName;


    public CategoryItemHolder(View itemView) {
        super(itemView);
        mItemIcon = findViewById(R.id.item_icon);
        mItemName = findViewById(R.id.item_name);
    }

    @Override
    public void bind(@NonNull CategoryItemBean item) {

        mItemName.setText(item.getName());

        RequestOptions options = new RequestOptions();
        options.error(R.mipmap.ic_launcher);
        Glide.with(mItemIcon)
                .load(item.getIcon())
                .into(mItemIcon);
    }
}
